<?php 
  require_once("../../includes/config.php"); 
  if(isset($_GET['id']))
  {
    $is_checkout = 0;
    $conracts = query('SELECT * FROM contracts 
      LEFT JOIN clients ON 
        contracts.client_id=clients.id 
      LEFT JOIN companies ON 
        contracts.company_id=companies.company_id WHERE contracts.contract_id=?',$_GET['id']);
    $contract = $conracts[0];
    if(isset($_GET['amount']))
    {
      $amount = $_GET['amount'];
      $is_checkout = 1;
      
    }
    else
      $amount = 0;
    
    
    if(isset($_GET['type']))
      $type = 1;
    else
      $type = 0;
    
    
    renderWithoutHeader("payment_vouchers/create.php", array("contract"=>$contract,"payment_method"=>$payment_method,"amount"=>$amount,"type"=>$type,"is_checkout"=>$is_checkout));

  }  

?>